﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace eComet
{
    public class Helper
    {
        public static Boolean SetCurrentDirectory([MarshalAs(UnmanagedType.LPTStr)]string lpPathName)
        {
            return Helpers.SetCurrentDirectory(lpPathName);
        }

        public static uint GetFileAttributes([MarshalAs(UnmanagedType.LPTStr)]string lpPathName)
        {
            return Helpers.GetFileAttributes(lpPathName);
        }
        
        public const uint FILE_ATTRIBUTE_DIRECTORY = 0x00000010;

        public static Boolean CreateProcess(
            string lpApplicationName,
            string lpCommandLine,
            uint lpProcessAttributes,
            uint lpThreadAttributes,
            Boolean bInheritHandles,
            uint dwCreationFlags,
            uint lpEnvironment,
            string lpCurrentDirectory,
            StartupInfo lpStartupInfo,
            ProcessInformation lpProcessInformation)
        {
            return Helpers.CreateProcess(
            lpApplicationName,
            lpCommandLine,
            lpProcessAttributes,
            lpThreadAttributes,
            bInheritHandles,
            dwCreationFlags,
            lpEnvironment,
            lpCurrentDirectory,
            lpStartupInfo,
            lpProcessInformation);
        }

        public static uint DragQueryFile(uint hDrop, uint iFile, StringBuilder buffer, int cch)
        {
            return Helpers.DragQueryFile(hDrop, iFile, buffer, cch);
        }

        public static uint CreatePopupMenu()
        {
            return Helpers.CreatePopupMenu();
        }

        public static int MessageBox(int hWnd, string text, string caption, int type)
        {
            return Helpers.MessageBox(hWnd, text, caption, type);
        }

        public static int InsertMenuItem(uint hmenu, uint uposition, uint uflags, ref MENUITEMINFO mii)
        {
            return Helpers.InsertMenuItem(hmenu, uposition, uflags, ref mii);
        }
    }
}
